package com.itboye.mybatis.enumtype;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;

import java.io.IOException;

/**
 * 枚举
 * Created by hebidu on 16/7/20.
 */
public class CodeTypeSerializer extends JsonSerializer<CodeType> {
    @Override
    public void serialize(CodeType value, JsonGenerator jgen, SerializerProvider provider)
            throws IOException {
//        jgen.writeStartObject();
        jgen.writeString(""+value.getValue());
//        jgen.writeEndObject();
    }
}
